Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VACMS-16233 make script batches pick up where they left off #17236

Merged

Conversation

swirtSJW
Copy link
Contributor

@swirtSJW swirtSJW commented Feb 14, 2024

Description

Relates to #16233

This makes it possible to resume the menu altering script from any given point if the script dies like it did the first two attempts to run it on prod.

This creates the ability for the execution of batched scripts to keep state using the Drupal State API to keep track of the last successfully completed batch and pick up where it left off on subsequent runs.

On prod the script ran out of memory processing run number 118. It is most likely that 118 ran successfully and it was actually 119 that failed, but to be safe, we will run it from 117 on by doing the following

  • Set the last run state to 117 with
    ddev drush state:set script_library__va_gov_vamc_get_system_menus 117
  • Run the script with drush scr ./scripts/content/VACMS-16233-reorder-vamc-menu-items.php

Testing done

Screenshots

QA steps

  • Login to Tugboat dashboard

  • Open the php terminal

  • run ddev drush state:set script_library__va_gov_vamc_get_system_menus 117

  • run drush scr ./scripts/content/VACMS-16233-reorder-vamc-menu-items.php

  • Validate output looks like:
    image

  • When complete, validate that VA Spokane health care has been re-ordered (the first item in the resumed
    image

  • validate that VA St Cloud menu has been rearranged (to rule out off-by-one error)
    image

  • validate VA Lebanon has been rearranged (to rule out off by one error on other end - the last one in the list)
    image

Definition of Done

  • Documentation has been updated, if applicable.
  • Tests have been added if necessary.
  • Automated tests have passed.
  • Code Quality Tests have passed.
  • Acceptance Criteria in related issue are met.
  • Manual Code Review Approved.
  • If there are field changes, front end output has been thoroughly checked.

Select Team for PR review

  • CMS Team
  • Public websites
  • Facilities
  • User support
  • Accelerated Publishing

Is this PR blocked by another PR?

  • DO NOT MERGE

Does this PR need review from a Product Owner

  • Needs PO review

CMS user-facing announcement

Is an announcement needed to let editors know of this change?

  • Yes, and it's written in issue ____ and queued for publication.
    • Merge and ping the UX writer so they are ready to publish after deployment
  • Yes, but it hasn't yet been written
    • Don't merge yet -- ping the UX writer to write and queue content
  • No announcement is needed for this code change.
    • Merge & carry on unburdened by announcements

Copy link
Contributor

@omahane omahane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great. Getting and setting state for a series of script runs should be useful going forward, too.

@omahane omahane self-requested a review February 14, 2024 13:37
omahane
omahane previously approved these changes Feb 14, 2024
Copy link
Contributor

@omahane omahane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see no issues here.

@va-cms-bot va-cms-bot temporarily deployed to Tugboat February 15, 2024 04:22 Destroyed
@omahane omahane requested a review from edmund-dunn February 15, 2024 15:16
Copy link
Contributor

@edmund-dunn edmund-dunn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nicely done! Approved!

@omahane omahane enabled auto-merge (squash) February 15, 2024 17:00
@va-cms-bot va-cms-bot temporarily deployed to Tugboat February 15, 2024 17:01 Destroyed
@omahane omahane merged commit 6d4696e into main Feb 15, 2024
18 checks passed
@omahane omahane deleted the VACMS-16233-Make-script-batches-pick-up-where-they-left-off branch February 15, 2024 17:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants